from django.contrib import admin
from .models import ChatRecord, WordReplyMap,Img


# Register your models here.


@admin.register(ChatRecord)
class ChatRecordAdmin(admin.ModelAdmin):
    search_fields = ['content']
    list_filter = ['sender', 'receiver', 'is_read', 'auto_reply', 'time']
    list_display = ['id', 'sender', 'receiver', 'content', 'is_read', 'is_return', 'auto_reply', 'time']
    save_on_top = True
    save_on_bottom = True


@admin.register(WordReplyMap)
class WordReplyMapAdmin(admin.ModelAdmin):
    search_fields = ['reply']
    list_filter = ['word']
    list_display = ['id', 'word', 'reply']
    save_on_top = True
    save_on_bottom = True


@admin.register(Img)
class ImgAdmin(admin.ModelAdmin):
    
    list_filter = ['uploader','img']
    list_display = ['id', 'uploader', 'img','time']
    save_on_top = True
    save_on_bottom = True
